import { getAction,deleteAction,putAction,postAction} from '@/api/manage'

////根路径
// const doMian = "/pms/";
////图片预览请求地址
// const imgView = "http://localhost:8080/pms/sys/common/view/";

//角色管理
const addRole = (params)=>postAction("/sys/role/add",params);
const editRole = (params)=>putAction("/sys/role/edit",params);
// const getRoleList = (params)=>getAction("/sys/role/list",params);
// const deleteRole = (params)=>deleteAction("/sys/role/delete",params);
// const deleteRoleList = (params)=>deleteAction("/sys/role/deleteBatch",params);
const checkRoleCode = (params)=>getAction("/sys/role/checkRoleCode",params);
const queryall = (params)=>getAction("/sys/role/queryall",params);

//用户管理
const addUser = (params)=>postAction("/sys/user/add",params);
const editUser = (params)=>putAction("/sys/user/edit",params);
const queryUserRole = (params)=>getAction("/sys/user/queryUserRole",params);
const getUserList = (params)=>getAction("/sys/user/list",params);
// const deleteUser = (params)=>deleteAction("/sys/user/delete",params);
// const deleteUserList = (params)=>deleteAction("/sys/user/deleteBatch",params);
const frozenBatch = (params)=>putAction("/sys/user/frozenBatch",params);
//验证用户是否存在
const checkOnlyUser = (params)=>getAction("/sys/user/checkOnlyUser",params);
//改变密码
const changPassword = (params)=>putAction("/sys/user/changPassword",params);

//权限管理
const addPermission= (params)=>postAction("/sys/permission/add",params);
const editPermission= (params)=>putAction("/sys/permission/edit",params);
const getPermissionList = (params)=>getAction("/sys/permission/list",params);
/*update_begin author:wuxianquan date:20190908 for:添加查询一级菜单和子菜单查询api */
const getSystemMenuList = (params)=>getAction("/sys/permission/getSystemMenuList",params);
const getSystemSubmenu = (params)=>getAction("/sys/permission/getSystemSubmenu",params);
/*update_end author:wuxianquan date:20190908 for:添加查询一级菜单和子菜单查询api */

// const deletePermission = (params)=>deleteAction("/sys/permission/delete",params);
// const deletePermissionList = (params)=>deleteAction("/sys/permission/deleteBatch",params);
const queryTreeList = (params)=>getAction("/sys/permission/queryTreeList",params);
const queryTreeListForRole = (params)=>getAction("/sys/role/queryTreeList",params);
const queryListAsync = (params)=>getAction("/sys/permission/queryListAsync",params);
const queryRolePermission = (params)=>getAction("/sys/permission/queryRolePermission",params);
const saveRolePermission = (params)=>postAction("/sys/permission/saveRolePermission",params);
//const queryPermissionsByUser = (params)=>getAction("/sys/permission/queryByUser",params);
const queryPermissionsByUser = (params)=>getAction("/sys/permission/getUserPermissionByToken",params);
const loadAllRoleIds = (params)=>getAction("/sys/permission/loadAllRoleIds",params);
const getPermissionRuleList = (params)=>getAction("/sys/permission/getPermRuleListByPermId",params);
const queryPermissionRule = (params)=>getAction("/sys/permission/queryPermissionRule",params);

// 部门管理
const queryDepartTreeList = (params)=>getAction("/sys/sysDepart/queryTreeList",params);
const queryIdTree = (params)=>getAction("/sys/sysDepart/queryIdTree",params);
const queryParentName   = (params)=>getAction("/sys/sysDepart/queryParentName",params);
const searchByKeywords   = (params)=>getAction("/sys/sysDepart/searchBy",params);
const deleteByDepartId   = (params)=>deleteAction("/sys/sysDepart/delete",params);

//日志管理
//const getLogList = (params)=>getAction("/sys/log/list",params);
const deleteLog = (params)=>deleteAction("/sys/log/delete",params);
const deleteLogList = (params)=>deleteAction("/sys/log/deleteBatch",params);

//数据字典
const addDict = (params)=>postAction("/sys/dict/add",params);
const editDict = (params)=>putAction("/sys/dict/edit",params);
//const getDictList = (params)=>getAction("/sys/dict/list",params);
const treeList = (params)=>getAction("/sys/dict/treeList",params);
// const delDict = (params)=>deleteAction("/sys/dict/delete",params);
//const getDictItemList = (params)=>getAction("/sys/dictItem/list",params);
const addDictItem = (params)=>postAction("/sys/dictItem/add",params);
const editDictItem = (params)=>putAction("/sys/dictItem/edit",params);
//const delDictItem = (params)=>deleteAction("/sys/dictItem/delete",params);
//const delDictItemList = (params)=>deleteAction("/sys/dictItem/deleteBatch",params);

//字典标签专用（通过code获取字典数组）
export const ajaxGetDictItems = (code, params)=>getAction(`/sys/dict/getDictItems/${code}`,params);

//系统通告
const doReleaseData = (params)=>getAction("/sys/annountCement/doReleaseData",params);
const doReovkeData = (params)=>getAction("/sys/annountCement/doReovkeData",params);
//获取系统访问量
const getLoginfo = (params)=>getAction("/sys/loginfo",params);
const getVisitInfo = (params)=>getAction("/sys/visitInfo",params);
//数据日志访问
// const getDataLogList = (params)=>getAction("/sys/dataLog/list",params);

// 根据部门主键查询用户信息
const queryUserByDepId = (params)=>getAction("/sys/user/queryUserByDepId",params);

// 查询用户角色表里的所有信息
const queryUserRoleMap = (params)=>getAction("/sys/user/queryUserRoleMap",params);
// 重复校验
const duplicateCheck = (params)=>getAction("/sys/duplicate/check",params);
// 加载分类字典
const loadCategoryData = (params)=>getAction("/sys/category/loadAllData",params);

// 获取总经理评分列表
const getGmDatagrid = (params) => postAction("/api/pms/gm/gmDatagrid", params);

// 获取总经理评分进度
const getGmGradedRadio = (params) => postAction("/api/pms/gm/gmGradedRadio", params);

// 总经理评分保存
const saveGmScores = (params) => postAction("/api/pms/gm/saveScores", params);

// 总经理评分 得分计算
const calcScores = (params) => postAction("/api/pms/gm/calcScores", params);

// 获取绩效汇总评分列表
const getKaGradeDatagrid = (params) => postAction("/api/pms/kpiadmin/kaGradeDatagrid", params);

// 绩效汇总评分保存
const saveKaGradeSave = (params) => postAction("/api/pms/kpiadmin/kaGradeSave", params);

//督办事项查看
const getSysConfig = ()=>getAction("/api/pms/common/getSysConfig?configCode=referenceUrl");

// 绩效汇总评分 得分计算
const kaGradeCalc = (params) => postAction("/api/pms/kpiadmin/kaGradeCalc", params);

// 绩效计算审核 得分计算
const kaMgrCalc = (params) => postAction("api/pms/kpiadmin/kaMgrCalc", params);

// 部门评分参考（双向评分记录-独立页面）
const getCgDatagrid = (params) => postAction("/api/pms/gm/cgDatagrid", params);

// 部门评分参考（总经理评分双向评分记录-弹窗）
const getCgGmDatagrid = (params) => postAction("/api/pms/gm/cgGmDatagrid", params);

// 部门评分参考（绩效汇总双向评分记录-右）
const getKaCgDatagrid = (params) => postAction('api/pms/kpiadmin/kaCgDatagrid', params);

// 部门类别与部门
const getIndexGroupOrgs = (params) => getAction("/api/pms/common/indexGroupOrgs", params);

// 所有部门
const getAllOrgs = () => getAction("/api/pms/common/getAllOrgs", null);

// 获取被评分部门与评分部门级联关系
const getGradeOrgs = (params) => getAction("/api/pms/common/gradeOrgs", params);

// 获取绩效评分记录
const getScoreDatagrid = (params) => postAction('/api/pms/gm/scoreDatagrid', params);

// 获取进度概览
const getKaProgressView = (params) => getAction('/api/pms/kpiadmin/kaProgressView', params);

// 获取进度详情
const getKaProgressDetail = (params) => getAction('/api/pms/kpiadmin/kaProgressDetail', params);

// 目标值实际值填报-列表条件
const getKaFillConditions = (params) => postAction('/api/pms/kpiadmin/kaFillConditions', params);

// 绩效管理员绩效审核详情/审核员绩效考核详情-列表条件
const getKaFillConditionsForChangeUser = (params) => postAction('/api/pms/kpiadmin/kaFillConditionsForChangeUser', params);

// 获取绩效填报-列表信息
const getKaFillDatagrid = (params) => postAction('/api/pms/kpiadmin/kaFillDatagrid', params);

// 保存绩效填报列表
const saveKaFill = (params) => postAction('/api/pms/kpiadmin/kaFillSave', params);

// 获取指标列表
const getIndexCodes = (params) => getAction('/api/pms/common/indexCodes', params);

// 获取绩效达成率
// const getGradeIndexChart = (params) => postAction('/api/pms/scoring/gradeIndexChart', params);
const getGradeIndexChart = (params) => postAction('/api/pms/scoring/gradeIndexChartNew', params);

// 双向评分-获取指标列表
const getScoreIndexCodes = (params) => getAction('/api/pms/scoring/indexCodes', params);

// 双向评分-获取列表信息
const _getScoreDatagrid = (params) => postAction('/api/pms/scoring/scoreDatagrid', params);

// 双向评分-保存意见
const saveScoreComment = (params) => postAction('/api/pms/scoring/scoreCommentSave', params);

// 双向评分-保存评分
const saveScoreValue = (params) => postAction('/api/pms/scoring/scoreValueSave', params);

// 导出我的绩效详情
const exportXlsx = (params) => postAction('/api/pms/report/exportXlsx', params);

// 根据指标获取指标值列表
const getIndexValueCodes = (params) => getAction('/api/pms/common/indexValueCodes', params);

// 获取绩效目标值-列表条件
const getKaTargetConditions = (params) => postAction('/api/pms/kpiadmin/kaTargetConditions', params);

// 获取绩效目标值-列表信息
const getKaTargetDatagrid = (params) => postAction('/api/pms/kpiadmin/kaTargetDatagrid', params);

// 设定目标值-列表保存
const saveKaTargetSave = (params) => postAction('/api/pms/kpiadmin/kaTargetSave', params);

// 公共接口 获取评分年月信息
const getYearMonthList = (params) => getAction('/api/pms/common/yearMonthList', params);

// 获取 kpi 评分年月信息
const getKpiYearMonthList = (params) => getAction('/api/pms/kpiadmin/yearMonthList', params);
const currentYearMonthList = (params) => getAction('/api/pms/kpiadmin/currentYearMonthList', params);

// 获取绩效评分参考列表（总经理评分弹窗-左）
const getScoreGmDatagrid = (params) => postAction('/api/pms/gm/scoreGmDatagrid', params);

// 获取绩效评分参考列表（绩效汇总弹窗-左）
const getKaScoreDatagrid = (params) => postAction("/api/pms/kpiadmin/kaScoreDatagrid", params);

// 获取权重管理列表条件
const getKaWeightConditions = (params) => getAction('/api/pms/kpiadmin/kaWeightConditions', params);

// 获取权重管理列表
const getKaWeightDatagrid = (params) => postAction('/api/pms/kpiadmin/kaWeightDatagrid', params);

// 保存权重管理列表
const saveKaWeightSave = (params) => postAction('/api/pms/kpiadmin/kaWeightSave', params);

// 绩效核对
// 绩效审核--日期/api/pms/kpiAudit/auditDatagrid
const auditDatagrid = (params) => postAction('/api/pms/kpiAudit/auditDatagrid', params);
//绩效审核-详情/api/pms/kpiAudit/auditDetails
const auditDetails = (params) => postAction('/api/pms/kpiAudit/auditDetails', params);
// 绩效汇总计算-列表条件
const getKaMgrConditions = (params) => postAction('/api/pms/kpiadmin/kaMgrConditions', params);

//绩效审核-审核操作按钮api/pms/kpiAudit/auditAction
// auditType=atSubmit: 提交申请 ；auditType=atReject: 审批退回；auditType=atAccept: 审批通过
const auditAction = (params) => postAction('/api/pms/kpiAudit/auditAction', params);
// 绩效汇总计算-列表信息
const getKaMgrDatagrid = (params) => postAction('/api/pms/kpiadmin/kaMgrDatagrid', params);

// 审核员绩效考核详情/绩效管理员绩效审核详情 -列表信息
const getAuditDetailDatagrid = (params) => postAction('/api/pms/kpiadmin/auditDetailDatagrid', params);

// 绩效汇总计算-列表保存
const saveKaMgrSave = (params) => postAction('/api/pms/kpiadmin/kaMgrSave', params);

// 获取 绩效审核记录列表信息
const getAuditRecords = (params) => postAction('/api/pms/kpiAudit/auditRecords', params);

// 获取 组织类型(指标归属)信息接口
const getOrgTypes = (params) => getAction('/api/pms/common/orgTypes', params);


// 获取 审核状态
const getKaMgrStatus = (params) => postAction('/api/pms/kpiadmin/kaMgrStatus', params);

// 定时任务
const getTaskStatus = (params) => postAction('/api/pms/common/taskStatus', params);

// 获取年份列表
const getCheckYearList = (params) => getAction('/api/pms/common/checkYearList', params);

// 获取我的绩效概览信息
const getGradeViewDatagrid = (params) => postAction('/api/pms/scoring/gradeViewDatagrid', params);

// 获取我的绩效详情列表
const getGradeDetailDatagrid = (params) => postAction('/api/pms/scoring/gradeDetailDatagrid', params);

// 绩效考核报表导出
const exportReport = (params) => postAction('/api/pms/report/exportXlsx', params);

// 获取绩效考核报表列表
const getReportList = (params) => getAction('/api/pms/report/list', params);

// 生成当期所有\某一条报表
const reportCreator = (params) => postAction('/api/pms/report/creator', params);

// 获取数据类型
const getDataTypeQuery = (params) => postAction('/api/pms/budget/dataTypeQuery', params);

// 设置数据类型
const setDataTypeCtrl = (params) => postAction('/api/pms/budget/dataTypeCtrl', params);

// 获取指标树
const getIndexTree = (params) => postAction('/api/pms/repos/indexRepo/indexTree', params);

// 新增树节点
const addNode = (params) => postAction('/api/pms/repos/indexRepo/addNode', params);

// 删除树节点
const delNode = (params) => postAction('/api/pms/repos/indexRepo/delNode', params);

// 树节点查询
const queryAttrs = (params) => postAction('/api/pms/repos/indexRepo/queryAttrs', params);

// 获取 指标和指标值的属性信息
const getListAttrs = (params) => postAction('/api/pms/repos/indexRepo/listAttrs', params);

// 保存节点信息
const modifyAttrs = (params) => postAction('/api/pms/repos/indexRepo/modifyAttrs', params);

// 节点排序
const orderIndexs = (params) => postAction('/api/pms/repos/indexRepo/orderIndexs', params);

// 查询规则库（支持模糊查询）
const indexRuleDatagrid = (params) => postAction('/api/pms/repos/indexRepo/indexRuleDatagrid', params);

// 规则库保存单条
const indexRuleSave = (params) => postAction('/api/pms/repos/indexRepo/indexRuleSave', params);

// 规则数据项标识
const whichDataList = (params) => postAction('/api/pms/repos/indexRepo/whichDataList', params);

// 规则数据项编码
const searchIndexValue = (params) => postAction('/api/pms/repos/indexRepo/searchIndexValue', params);

// 数据管理-指标实际值-获取列表
const goalValueDatagrid = (params) => postAction('/api/pms/repos/dataMgr/goalValueDatagrid', params);

// 数据管理-指标实际值-确认数据
const goalValueConfirm = (params) => postAction('/api/pms/repos/dataMgr/goalValueConfirm', params);

// 数据管理-指标实际值-修改单条数据
const goalValueModify = (params) => postAction('/api/pms/repos/dataMgr/goalValueModify', params);

// 数据管理-指标实际值-导入 EXCEL 数据
const goalValueImport = (params) => postAction('/api/pms/repos/dataMgr/goalValueImport', params);

// 维度
const indexAttrs = (params) => postAction('/api/pms/common/indexAttrs', params);

// 获取评分事项列表
const gradeEvents = (params) => getAction('/api/pms/scoring/gradeEvents', params);

const getCommentsReport = (params) => postAction('/api/pms/gm/getCommentsReport', params);




export {
  // imgView,
  // doMian,
  addRole,
  editRole,
  checkRoleCode,
  addUser,
  editUser,
  queryUserRole,
  getUserList,
  queryall,
  frozenBatch,
  checkOnlyUser,
  changPassword,
  getPermissionList,
  addPermission,
  editPermission,
  queryTreeList,
  queryListAsync,
  queryRolePermission,
  saveRolePermission,
  queryPermissionsByUser,
  loadAllRoleIds,
  getPermissionRuleList,
  queryPermissionRule,
  queryDepartTreeList,
  queryIdTree,
  queryParentName,
  searchByKeywords,
  deleteByDepartId,
  deleteLog,
  deleteLogList,
  addDict,
  editDict,
  treeList,
  addDictItem,
  editDictItem,
  doReleaseData,
  doReovkeData,
  getLoginfo,
  getVisitInfo,
  queryUserByDepId,
  queryUserRoleMap,
  duplicateCheck,
  queryTreeListForRole,
  getSystemMenuList,
  getSystemSubmenu,
  loadCategoryData,
  getGmDatagrid,
  saveGmScores,
  getCgDatagrid,
  getGmGradedRadio,
  getIndexGroupOrgs,
  getAllOrgs,
  getScoreDatagrid,
  getGradeOrgs,
  getKaFillConditions,
  getKaFillConditionsForChangeUser,
  getKaFillDatagrid,
  saveKaFill,
  getIndexCodes,
  getScoreIndexCodes,
  _getScoreDatagrid,
  getIndexValueCodes,
  getKaTargetConditions,
  getKaTargetDatagrid,
  saveKaTargetSave,
  getYearMonthList,
  getKpiYearMonthList,
  currentYearMonthList,
  getScoreGmDatagrid,
  getCgGmDatagrid,
  getKaWeightConditions,
  getKaWeightDatagrid,
  auditDatagrid,
  auditDetails,
  auditAction,
  saveKaWeightSave,
  getKaGradeDatagrid,
  saveKaGradeSave,
  getSysConfig,
  kaGradeCalc,
  calcScores,
  getKaScoreDatagrid,
  getKaCgDatagrid,
  getKaMgrConditions,
  getKaMgrDatagrid,
  saveKaMgrSave,
  getAuditRecords,
  getOrgTypes,
  getKaMgrStatus,
  getTaskStatus,
  getCheckYearList,
  getGradeViewDatagrid,
  getGradeDetailDatagrid,
  exportReport,
  getReportList,
  reportCreator,
  saveScoreComment,
  saveScoreValue,
  getGradeIndexChart,
  exportXlsx,
  getKaProgressView,
  getKaProgressDetail,
  getDataTypeQuery,
  setDataTypeCtrl,
  getIndexTree,
  addNode,
  delNode,
  queryAttrs,
  getListAttrs,
  modifyAttrs,
  orderIndexs,
  indexRuleDatagrid,
  indexRuleSave,
  whichDataList,
  searchIndexValue,
  kaMgrCalc,
  goalValueDatagrid,
  goalValueConfirm,
  goalValueModify,
  goalValueImport,
  indexAttrs,
  gradeEvents,
  getAuditDetailDatagrid,
  getCommentsReport
}



